Repository navigation
Make the per-message undo checkpoint incremental (fixes ~1s Enter lag) - #7
Merged
Merged
Conversation
Every message runs nexusCheckpoint() synchronously before it is sent. It built the snapshot with `git add -A` into a temp index that was deleted each time, so git had no stat cache and rehashed the entire working tree on every Enter - including .nexus/session.json, which can grow to tens of MB, before removing .nexus from the snapshot again. On a large repo with a long session that was ~1.3s per message. - keep the temp index between turns, seeded once from the repo's own index, so only changed files are rehashed; - exclude .nexus in the add pathspec so the session file is never hashed. Snapshots are byte-identical to before (verified, including after an edit, a new file and a deletion). Measured with a real 90 MB session: Enter to sent went from ~1350 ms to ~67 ms; checkpoint alone on a darknode-web clone from 290-1440 ms to ~16 ms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every message runs nexusCheckpoint() synchronously before it is sent. It
built the snapshot with
git add -Ainto a temp index that was deletedeach time, so git had no stat cache and rehashed the entire working tree
on every Enter - including .nexus/session.json, which can grow to tens
of MB, before removing .nexus from the snapshot again. On a large repo
with a long session that was ~1.3s per message.
index, so only changed files are rehashed;
Snapshots are byte-identical to before (verified, including after an
edit, a new file and a deletion). Measured with a real 90 MB session:
Enter to sent went from ~1350 ms to ~67 ms; checkpoint alone on a
darknode-web clone from 290-1440 ms to ~16 ms.